// 全局样式重置
// 注意：变量已通过 vite.config.ts 全局注入，无需再次导入
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: $text-color;
    background-color: $background-color;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

#app {
    height: 100%;
    overflow-x: hidden;
}

// 移动端适配
html {
    font-size: 16px;

    @media screen and (max-width: 375px) {
        font-size: 14px;
    }

    @media screen and (min-width: 414px) {
        font-size: 18px;
    }
}

// 安全区域适配
.safe-area-top {
    padding-top: $safe-area-inset-top;
}

.safe-area-bottom {
    padding-bottom: $safe-area-inset-bottom;
}

.safe-area-left {
    padding-left: $safe-area-inset-left;
}

.safe-area-right {
    padding-right: $safe-area-inset-right;
}

// 通用工具类
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

// 间距工具类
.m-0 {
    margin: 0;
}

.m-1 {
    margin: $spacing-xs;
}

.m-2 {
    margin: $spacing-sm;
}

.m-3 {
    margin: $spacing-md;
}

.m-4 {
    margin: $spacing-lg;
}

.m-5 {
    margin: $spacing-xl;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: $spacing-xs;
}

.p-2 {
    padding: $spacing-sm;
}

.p-3 {
    padding: $spacing-md;
}

.p-4 {
    padding: $spacing-lg;
}

.p-5 {
    padding: $spacing-xl;
}

// 文本样式
.text-xs {
    font-size: $font-size-xs;
}

.text-sm {
    font-size: $font-size-sm;
}

.text-md {
    font-size: $font-size-md;
}

.text-lg {
    font-size: $font-size-lg;
}

.text-xl {
    font-size: $font-size-xl;
}

.font-normal {
    font-weight: $font-weight-normal;
}

.font-medium {
    font-weight: $font-weight-medium;
}

.font-bold {
    font-weight: $font-weight-bold;
}

// 颜色工具类
.text-primary {
    color: $primary-color;
}

.text-success {
    color: $success-color;
}

.text-warning {
    color: $warning-color;
}

.text-danger {
    color: $danger-color;
}

.text-muted {
    color: $text-color-3;
}

// 背景色工具类
.bg-primary {
    background-color: $primary-color;
}

.bg-success {
    background-color: $success-color;
}

.bg-warning {
    background-color: $warning-color;
}

.bg-danger {
    background-color: $danger-color;
}

.bg-white {
    background-color: $white;
}

.bg-gray {
    background-color: $gray-1;
}

// 圆角工具类
.rounded-sm {
    border-radius: $border-radius-sm;
}

.rounded-md {
    border-radius: $border-radius-md;
}

.rounded-lg {
    border-radius: $border-radius-lg;
}

.rounded-xl {
    border-radius: $border-radius-xl;
}

.rounded-full {
    border-radius: 50%;
}

// 阴影工具类
.shadow-light {
    box-shadow: $box-shadow-light;
}

.shadow-medium {
    box-shadow: $box-shadow-medium;
}

.shadow-heavy {
    box-shadow: $box-shadow-heavy;
}

// 动画类
.fade-enter-active,
.fade-leave-active {
    transition: opacity $animation-duration-base $ease-in-out;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.slide-up-enter-active,
.slide-up-leave-active {
    transition: transform $animation-duration-base $ease-in-out;
}

.slide-up-enter-from,
.slide-up-leave-to {
    transform: translateY(100%);
}

// 能力维度颜色
.ability-breaking-ice {
    color: $ability-breaking-ice;
}

.ability-empathy {
    color: $ability-empathy;
}

.ability-conversation-flow {
    color: $ability-conversation-flow;
}

// 情绪状态颜色
.emotion-very-happy {
    color: $emotion-very-happy;
}

.emotion-happy {
    color: $emotion-happy;
}

.emotion-neutral {
    color: $emotion-neutral;
}

.emotion-sad {
    color: $emotion-sad;
}

.emotion-angry {
    color: $emotion-angry;
}

// 自定义滚动条
.custom-scrollbar {
    &::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    &::-webkit-scrollbar-track {
        background: $gray-2;
        border-radius: 2px;
    }

    &::-webkit-scrollbar-thumb {
        background: $gray-5;
        border-radius: 2px;

        &:hover {
            background: $gray-6;
        }
    }
}

// 页面容器
.page-container {
    min-height: 100vh;
    background-color: $background-color;
    padding-bottom: 50px; // 为底部导航留出空间
}

// 卡片样式
.card {
    background: $white;
    border-radius: $border-radius-lg;
    box-shadow: $box-shadow-light;
    padding: $spacing-md;
    margin-bottom: $spacing-md;
}

// 按钮样式增强
.btn-gradient {
    background: linear-gradient(135deg, $primary-color 0%, #4facfe 100%);
    border: none;
    color: $white;

    &:active {
        background: linear-gradient(135deg, darken($primary-color, 10%) 0%, darken(#4facfe, 10%) 100%);
    }
}